/*
package cn.com.test.common.upload;

import org.apache.catalina.core.ApplicationPart;

import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.Part;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet(value = {"/web/uploadServlet"})
@MultipartConfig(location = "D:\\temp")
public class UploadServlet extends HttpServlet {

	public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
		response.setContentType("text/html;charset=utf-8");
		PrintWriter pw = response.getWriter();
		String path = this.getServletContext().getRealPath("/");
		Part p = request.getPart("file");
		ApplicationPart part = (ApplicationPart) p;
		System.out.println(part.getName() + " " + part.getContentType() + " " + part.getSubmittedFileName());
		if (part.getSubmittedFileName().contains("xlsx")) {
*/
/*			String fileNameAll = part.getName(); //文件全路径名
			int pathIdx = fileNameAll.lastIndexOf("\\")+1;
			String fileName = fileNameAll.substring(pathIdx, fileNameAll.length());*//*

			p.write(path + "/upload/" + part.getSubmittedFileName());
			pw.println("文件上传成功！");
		} else {
			pw.println("请选择excel文件！");
		}
		pw.close();
	}
}
*/
